<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="imagePath" value="/b2b4shoumei_resources" />
<html>
<script>
	var ctx = "${ctx}";
	var imagePath = "${imagePath}";
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>商品订单</title>
<meta name="keywords"
	content="体验,友好,高级管理台,易用,高性能,高扩展性,bootstrap框架,响应式后台">
<meta name="description"
	content="这是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT">

<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}"
	rel="stylesheet" />
<link
	href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}"
	rel="stylesheet" />
<link href="${ctx}/static/css/animate.min.css?v=${static_version}"
	rel="stylesheet" />
<link href="${ctx}/static/css/style.min.css?v=${static_version}"
	rel="stylesheet" />
<link href="${ctx}/static/css/common.css?v=${static_version}"
	rel="stylesheet" />
<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css"
	rel="stylesheet">
<link href="${ctx}/static/css/plugins/webuploader/webuploader.css"
	rel="stylesheet" />
<link href="${ctx}/static/css/plugins/datapicker/datepicker3.css"
	rel="stylesheet">

<!-- Data Tables -->
<link
	href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css?v=${static_version}"
	rel="stylesheet" />
<!-- 插件样式  -->
<link
	href="${ctx}/static/css/plugins/markdown/bootstrap-markdown.min.css"
	rel="stylesheet" />
<style type="text/css">
.form-horizontal input[type="text"] {
	padding-top: 0
}
</style>
</head>
<body class="gray-bg">
	<!-- <nav class="breadcrumb">
		 首页
		 <span class="c-gray en">&gt;</span>活动订单列表中心


		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px"
			onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
		</nav> -->
	<!-- <div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray">
			<span class="l"> 
			<a id="one" name="-1" class="title rleft def">所有活动</a>
			<a id="three" name="1" class="title def">即将开始</a>
			<a id="four" name="2" class="title def">已结束</a>
			</span>
		</div> -->

	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="ibox float-e-margins">

			<!-- 专场列表 -->
			<div class="ibox-title">
				<h5>
					特卖汇订单<small></small>
				</h5>
			</div>
			<div class="ibox-content">
				<div class="row">
					<form action="${ctx}/dingdan/myorderList" method="get"
						class="form form-horizontal" id="">
						<input type="hidden" id="type" name="type" value='3' />
						<div class="clearfix form-group">
							<div class="col-md-4" style="display: none">
								<label class="col-md-4 col-sm-4 control-label">订单类型：</label>
								<div class="col-md-8 col-sm-8">
									<span class="select-box"> <select name="ordertype"
										class="input-md form-control chosen-select">
											<option value="-1">--全部--</option>
											<option value="1">--待付款--</option>
											<option value="2">--已付款--</option>
											<option value="3">--已发货--</option>
											<option value="4">--已收货--</option>
											<option value="5">--已取消--</option>
											<option value="6">--退货中--</option>
											<option value="7">--退货成功--</option>
											<option value="8">--退货失败--</option>
									</select>
									</span>
								</div>
							</div>
							<div class="col-md-4">
								<label class="col-md-4 col-sm-4 control-label">订单状态:</label>
								<div class="col-md-8 col-sm-8">
									<span class="select-box"> <select name="ddStatus"
										class="input-md form-control chosen-select">
											<option value="-1">--全部--</option>
											<option value="1">--待付款--</option>
											<option value="2">--已付款--</option>
											<option value="3">--已发货--</option>
											<option value="4">--已收货--</option>
											<option value="5">--已取消--</option>
											<option value="6">--退货中--</option>
											<option value="7">--退货成功--</option>
											<option value="8">--退货失败--</option>
									</select>
									</span>
								</div>
							</div>
							<div class="col-md-3">
								<label class="col-md-4 col-sm-4 control-label">订单编号：</label>
								<div class="col-md-8 col-sm-8">
									<input type="text" name="orderNum" value="" id="rid"
										placeholder="订单编号" class="form-control">
								</div>
							</div>

							<div class="col-md-5">
								<label class="col-md-3 col-sm-3 control-label">时间段：</label>
								<div class="col-md-9 col-sm-9">
									<div class="input-daterange input-group">
										<input id="startTime" name="startTime" type="text"
											class="input-md form-control layer-date" placeholder="开始时间"
											onclick="new WdatePicker()"> <span
											class="input-group-addon">至</span> <input id="endTime"
											name="endTime" type="text"
											class="input-md form-control layer-date" placeholder="结束时间"
											onclick="new WdatePicker()">
									</div>
								</div>
							</div>
						</div>
						<div class="clearfix form-group">

							<div class="col-md-4">
								<label class="col-md-4 col-sm-4 control-label">发票状态：</label>
								<div class="col-md-8 col-sm-8">
									<span class="select-box"> <select name="fpStatus"
										class="input-md form-control chosen-select">
											<option value="-1">--全部--</option>
											<option value="0">--无--</option>
											<option value="1">--有--</option>
									</select>
									</span>
								</div>
							</div>
							<div class="col-md-3">
								<div class="col-md-4 col-sm-4">
									<button name="" id="" class="btn btn-primary fr"
										style="border-radius: 5px; float: right;" type="submit">
										搜索</button>
									<div style="width: 10px; height: 5px; float: right;"></div>
								</div>
							</div>
						</div>
					</form>
				</div>
				<div class="hr-line-dashed3" style="height: auto"></div>
				<table data-datatable="true"
					class="table table-striped table-bordered table-hover dataTables-example">
					<thead>
						<tr class="text-center">
							<th class="text-center">订单类型</th>
							<th class="text-center">订单编号</th>
							<th class="text-center">实收款（元）</th>
							<th class="text-center">发票</th>
							<th class="text-center">下单时间</th>
							<th class="text-center">订单状态</th>
							<th class="text-center">操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${newfind_list}" var="newfind">
							<tr>
								<input type="hidden" id="id" name="id"
									value='${newfind.ordernum}' />
								<td class="text-center"><c:choose>
										<c:when test="${newfind.ordertype==0}">
											购物订单
										</c:when>
										<c:when test="${newfind.ordertype==1}">
											充值订单
										</c:when>
										<c:when test="${newfind.ordertype==2}">
											充值有礼
										</c:when>
										<c:when test="${newfind.ordertype==3}">
											积分兑换
										</c:when>
										<c:when test="${newfind.ordertype==4}">
											一元购
										</c:when>
										<c:when test="${newfind.ordertype==5}">
											广告订单
										</c:when>
										<c:when test="${newfind.ordertype==6}">
											普通红包订单
										</c:when>
										<c:when test="${newfind.ordertype==7}">
											申请合伙人订单
										</c:when>
									</c:choose></td>
								<td class="text-center">${newfind.ordernum}</td>
								<td class="text-center">${newfind.money}</td>
								<td class="text-center"><c:choose>
										<c:when test="${empty newfind.receipt_title}">未开发票 </c:when>
										<c:otherwise> 已开发票</c:otherwise>
									</c:choose></td>
								<td class="text-center">${newfind.appdate}</td>
								<td class="text-center"><c:choose>
										<c:when test="${newfind.dd_status==1}">
											待付款
										</c:when>
										<c:when test="${newfind.dd_status==2}">
											已付款
										</c:when>
										<c:when test="${newfind.dd_status==3}">
											已发货
										</c:when>
										<c:when test="${newfind.dd_status==4}">
											已收货
										</c:when>
										<c:when test="${newfind.dd_status==5}">
											已取消
										</c:when>
										<c:when test="${newfind.dd_status==6}">
											退货中
										</c:when>
										<c:when test="${newfind.dd_status==7}">
											退货成功
										</c:when>
										<c:when test="${newfind.dd_status==8}">
											退货失败
										</c:when>
									</c:choose></td>
								<td class="text-center"><c:if
										test="${newfind.dd_status==1}">
										<a class="btn btn-primary"
											onclick="to_pay(${newfind.ordernum})"
											href="javascript:void(0);" title="去支付">去支付</a>
									</c:if></td>
							<tr>
						</c:forEach>
					</tbody>
				</table>

			</div>
		</div>
	</div>
	<script src="${ctx}/static/js/jquery.min.js"></script>
	<script src="${ctx}/static/js/bootstrap.min.js"></script>
	<script src="${ctx}/static/js/plugins/footable/footable.all.min.js"></script>
	<script src="${ctx}/static/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="${ctx}/static/js/plugins/validate/messages_zh.min.js"></script>
	<script src="${ctx}/static/js/plugins/webuploader/webuploader.min.js"></script>
	<script src="${ctx}/static/js/plugins/summernote/summernote.min.js"></script>
	<script src="${ctx}/static/js/plugins/summernote/summernote-zh-CN.js"></script>
	<script src="${ctx}/static/js/plugins/chosen/chosen.jquery.js"></script>
	<script src="${ctx}/static/js/plugins/layer/laydate/laydate.js"></script>
	<script src="${ctx}/static/js/plugins/iCheck/icheck.min.js"></script>
	<script src="${ctx}/static/plugins/laypage/laypage.js"></script>
	<script src="${ctx}/static/js/plugins/switchery/switchery.js"></script>
	<script src="${ctx}/static/js/eModal.min.js"></script>
	<script src="${ctx}/static/js/cookie.js"></script>
	<script src="${ctx}/static/js/content.min.js"></script>
	<script src="${ctx}/static/js/contabs.min.js"></script>
	<script src="${ctx}/static/common/common.js"></script>
	<script src="${ctx}/static/js/plugins/ueditor-1.4.3/ueditor.config.js"></script>
	<script src="${ctx}/static/js/plugins/ueditor-1.4.3/ueditor.all.js"></script>
	<script src="${ctx}/static/js/plugins/uploadify/jquery.uploadify.js"></script>
	<script src="${ctx}/static/js/plugins/layer/layer.js"></script>
	<script
		src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js?v=${static_version}"></script>
	<script
		src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js?v=${static_version}"></script>
	<script
		src="${ctx}/static/js/My97DatePicker/WdatePicker.js?v=${static_version}"></script>
	<script type="text/javascript">
		/* $("#goods_table_search").click(function(){
		var name=$("#name").val();
		var type=$("#endType").val();
		var type1=$("#type1").val();
		var type2=$("#type2").val();
		var type3=$("#type3").val();
		alert(name);
		alert(type1);
		$.ajax({
			type : "post",
			url : "${ctx}/seller/goods-search",
			data : {name:name,type1:type1,type2:type2,type3:type3,type:type},
			success : function(msg) {
				//location.reload();
			}
		})
		}) */
		$(function() {

			$('.table-sort tbody').on('click', 'tr', function() {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				} else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
		});

		/*发货*/
		function newfind_send(obj, id) {
			var edit_page = "${ctx}/dingdan/newfind-send";
			$.ajax({
				type : "POST",
				url : edit_page,
				data : "id=" + id,
				error : function() {
					layer.msg('操作失败', {
						icon : 5,
						time : 1000
					});
				},
				success : function(msg) {
					layer.msg('发货成功', {
						icon : 6,
						time : 1000
					});
					location.reload();
				}
			});
		}

		/*删除*/
		function newfind_delete(obj, id) {
			var edit_page = "${ctx}/dingdan/newfind-delete";
			layer.confirm('确认删除？', {
				btn : [ '确认', '取消' ],
				shade : false
			}, function() {
				$.ajax({
					type : "POST",
					url : edit_page,
					data : "id=" + id,
					error : function() {
						layer.msg('操作失败', {
							icon : 5,
							time : 1000
						});
					},
					success : function(msg) {
						layer.msg('已删除 ', {
							icon : 6,
							time : 1000
						});
						$(obj).parents("body").find(".btn-refresh").click();
					}
				});
			}, function() {
				layer.msg('未删除', {
					icon : 5,
					time : 1000
				});
			});
		}

		function newfind_orderInfo(obj, id, user_id, w, h) {
			var edit_page = "${ctx}/dingdan/newfind-orderinfo-pre?id=" + id
					+ "&user_id=" + user_id;
			//layer_show("详情页面",edit_page,w,h);
			var index = layer.open({
				type : 2,
				title : "详情页面",
				content : edit_page
			});
			layer.full(index);
		}

		$(document).ready(function() {
			$(".dataTables-example").dataTable();
		});
		
		function to_pay(ordernum){
			location.href = "${ctx}/dingdan/topayjsp?ordernum=" + ordernum;
		}
	</script>
</body>
</html>